let sname = document.querySelector(".name");
let time = document.querySelector(".time");
let appointment = JSON.parse(sessionStorage.getItem("appointment"))
let stime = sessionStorage.getItem("time")


let namespan = document.createElement("span");
namespan.innerHTML = localStorage.getItem("name");
sname.appendChild(namespan);

let timespan = document.createElement("span");
timespan.innerHTML = stime;
time.appendChild(timespan);

function fn(){
    window.open("./index.html","_self")
}
window.onload = setTimeout(fn,10000);

quxiao.addEventListener("click",function(){
    ajax({
        url:`http://egg.flower.dbice.cn/api/appointment/${localStorage.getItem("id")}`,
        method:"PUT",
        data:{
            sessionId:localStorage.getItem("session_id"),
            isAppointment:'0'
        },
        headers:{
            token:localStorage.getItem("token")
        }
    }).then(res=>{
        alert("取消预约成功")
    })
})